﻿<!DOCTYPE html>
@{
    AdminPage backEndPage = ViewBag.AdminPage;
    GlobalConfiguration globalConfiguration = new GlobalConfigurations().GetGlobalConfiguration();
}
<html>
    <head>
	    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title>@backEndPage.PageName - MVCwCMS</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        @Styles.Render("~/bundles/backend-css")
        @{
            if (Request.UserAgent.Contains("MSIE 8.0", StringComparison.InvariantCultureIgnoreCase))
            {
                <script src="//oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
                <script src="//oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
            }
        }
    </head>
    <body>
        <div id="wrapper">
            @{
                if (BackEndSessions.CurrentUser.IsNull()) {
                    @RenderBody()
                }
                else
                {
                    if (backEndPage.IsModal)
                    {
                        <div id="page-wrapper-modal">
                            <div class="row">
                                <div class="col-lg-12">
                                    <h1 class="page-header">@backEndPage.PageName</h1>
                                </div>
                            </div>
                            @RenderBody()
                        </div>
                    }
                    else
                    {
                        <nav class="navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom: 0">
                            <div class="navbar-header">
                                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".sidebar-collapse">
                                    <span class="sr-only">Toggle navigation</span>
                                    <span class="icon-bar"></span>
                                    <span class="icon-bar"></span>
                                    <span class="icon-bar"></span>
                                </button>
                                <a class="navbar-brand" href="~/Admin">MVCwCMS</a>
                            </div>

                            <ul class="nav navbar-top-links navbar-right">
                                <li class="dropdown">
                                    <a class="dropdown-toggle" data-toggle="dropdown" href="#"><i class="fa fa-user fa-fw"></i> @BackEndSessions.CurrentUser.UserName (@BackEndSessions.CurrentUser.GroupName) <i class="fa fa-caret-down"></i></a>
                                    <ul class="dropdown-menu dropdown-user">
                                        <li><a href="~/" target="_blank"><i class="fa fa-globe fa-fw"></i> @Html.Raw(MVCwCMS.Resources.Strings.OpenWebsite)</a></li>
                                        <li><a href="~/Admin/ChangePassword"><i class="fa fa-lock fa-fw"></i> @Html.Raw(MVCwCMS.Resources.Strings.ChangePassword)</a></li>
                                        <li class="divider"></li>
                                        <li><a href="~/Admin/logout"><i class="fa fa-power-off fa-fw"></i> @Html.Raw(MVCwCMS.Resources.Strings.Logout)</a></li>
                                    </ul>
                                </li>
                            </ul>

                        </nav>
                    
                        <nav class="navbar-default navbar-static-side" role="navigation">
                            <div class="sidebar-collapse">
                                <div class="text-right menu-collapse-container"><i class="fa fa-arrows-h fa-border fa-lg menu-collapse text-danger" title="Collapse/Expand menu"></i></div>
                                @Html.Raw(BackEndSessions.CurrentMenu)
                            </div>
                        </nav>
                
                        <div id="page-wrapper">
                            <div class="row">
                                <div class="col-lg-12">
                                    <h1 class="page-header">@backEndPage.PageName</h1>
                                </div>
                            </div>
                            @RenderBody()
                        </div>
                    }
                }
            }
        </div>
        <script type="text/javascript">
            var adminLanguageCode = "@System.Configuration.ConfigurationManager.AppSettings["AdminLanguageCode"].ToLower()";
            var adminResourceType = "";
            var confirmDeleteItem = "@Html.Raw(MVCwCMS.Resources.Strings.ConfirmDeleteItem)";
            var dateFormat = "@globalConfiguration.DateFormat";
            var helpSelectMultipleFiles = "@Html.Raw(MVCwCMS.Resources.Strings.HelpSelectMultipleFiles)";
            var isRefresh = "@Request.QueryString["IsRefresh"].IfEmpty("false").ToLower()";
            var notAuthorizedToBrowsePage = "@Html.Raw(MVCwCMS.Resources.Strings.NotAuthorizedToBrowsePage)";
            var noFileSelected = "@Html.Raw(MVCwCMS.Resources.Strings.NoFileSelected)";
            var pressOkToDeleteSelectedFile = "@Html.Raw(MVCwCMS.Resources.Strings.PressOkToDeleteSelectedFile)";
            var pressOkToDeleteSelectedFolder = "@Html.Raw(MVCwCMS.Resources.Strings.PressOkToDeleteSelectedFolder)";
            var segmentNotEmptyPressOkToOverwrite = "@Html.Raw(MVCwCMS.Resources.Strings.SegmentNotEmptyPressOkToOverwrite)";
            var selectedFileCannotBeDeletedUsed = "@Html.Raw(MVCwCMS.Resources.Strings.SelectedFileCannotBeDeletedUsed)";
            var selectedFileCannotBeRenamedUsed = "@Html.Raw(MVCwCMS.Resources.Strings.SelectedFileCannotBeRenamedUsed)";
            var selectedFolderCannotBeDeletedNotEmpty = "@Html.Raw(MVCwCMS.Resources.Strings.SelectedFolderCannotBeDeletedNotEmpty)";
            var selectedFolderCannotBeDeletedRoot = "@Html.Raw(MVCwCMS.Resources.Strings.SelectedFolderCannotBeDeletedRoot)";
            var selectedFolderCannotBeRenamedNotEmpty = "@Html.Raw(MVCwCMS.Resources.Strings.SelectedFolderCannotBeRenamedNotEmpty)";
            var selectedFolderCannotBeRenamedRoot = "@Html.Raw(MVCwCMS.Resources.Strings.SelectedFolderCannotBeRenamedRoot)";
            var sessionExpiredLoginAgain = "@Html.Raw(MVCwCMS.Resources.Strings.SessionExpiredLoginAgain)";
            var timeFormat = "@globalConfiguration.TimeFormat";
            var toConfirmSubmitPressOK = "@Html.Raw(MVCwCMS.Resources.Strings.ToConfirmSubmitPressOK)";
            var toConfirmPressOK = "@Html.Raw(MVCwCMS.Resources.Strings.ToConfirmPressOK)";
            var typeTheNewFileName = "@Html.Raw(MVCwCMS.Resources.Strings.TypeTheNewFileName)";
            var typeTheNewFolderName = "@Html.Raw(MVCwCMS.Resources.Strings.TypeTheNewFolderName)";
            var youHaveUnsavedChanges = "@Html.Raw(MVCwCMS.Resources.Strings.YouHaveUnsavedChanges)";
        </script>
        <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
        <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
        <script type="text/javascript" src="~/Scripts/tinymce/tinymce.min.js"></script>
        <script type="text/javascript" src="~/ckfinder/ckfinder.js"></script>
        @Scripts.Render("~/bundles/backend-js")
    </body>
</html>